package com.itheima.demo07;

public class MainClass {
    public static void main(String[] args) {

        useCalculate(new Calculate() {
            @Override
            public int cal(int a, int b) {
                return a + b;
            }
        });

        useCalculate((a, b) -> a + b);
    }

    public static void useCalculate(Calculate calculate) {
        int result = calculate.cal(10, 20);
        System.out.println(result);
    }
}

interface Calculate {
    int cal(int a, int b);
}


